package com.example.hello.service.impl;

import com.example.hello.entity.Role;
import com.example.hello.mapper.RoleMapper;
import com.example.hello.service.RoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2022-07-22
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    @Override
    public Set<String> getRolesByUserId(Integer userId) {
        return new HashSet<>(baseMapper.getRolesByUser(userId));
    }
}
